<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->


<title>Triangle Wave</title>
<meta name="description" content="Triangle Wave">
<meta name="keywords" content="htmlatex">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<link rel="STYLESHEET" href="acm-00488_files/htmlatex.css">
</head><body bgcolor="#ffffff" lang="EN">
 <h1><center></center></h1>
 <table bgcolor="#0060f0"><tbody><tr><td><b><font color="#c0ffff" size="5">&nbsp;<a name="SECTION0001000000000000000000">Triangle Wave</a></font>&nbsp;</b></td></tr></tbody></table>
<p>
In this problem you are to generate a triangular wave form according to a specified pair of
Amplitude and Frequency.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001001000000000000000">Input and Output</a></font></h2>
<p>
The input begins with a single positive integer on a line by itself indicating
the number of the cases following, each of them as described below. This line is
followed by a blank line, and there is also a blank line between two consecutive
inputs.
</p><p>
Each input set will contain two integers, each on a separate line. The first integer is the Amplitude; the
second integer is the Frequency.
</p><p>
For each test case, the output must follow the description below. The outputs of
two consecutive cases will be separated by a blank line.
</p><p>
For the output of your program, you will be printing wave forms each separated by a blank line.
The total number of wave forms equals the Frequency, and the horizontal ``height'' of each wave
equals the Amplitude. The Amplitude will never be greater than nine.
</p><p>
The waveform itself should be filled with integers on each line which indicate the ``height'' of that
line.
</p><p>
<b>NOTE:</b> There is a blank line after each separate waveform, <b>excluding</b> the last one.
</p><h2><font color="#0070e8"><a name="SECTION0001002000000000000000">Sample Input</a></font></h2>
<p>

</p><pre>1

3
2</pre>
<h2><font color="#0070e8"><a name="SECTION0001003000000000000000">Sample Output</a></font></h2>
<p>
</p><pre>1
22
333
22
1

1
22
333
22
1</pre>
</body></html>